/**
 * 
 */
package com.woodbird.legend.data;

import java.util.HashMap;
import java.util.Map;

import com.woodbird.legend.configuration.Configuration;

/**
 * @author woodbird
 * @version 2010-3-1
 */
public class DataSet {

	private static Map<Object,Object> data = new HashMap<Object,Object>();
	
	static{
		Configuration conf = Configuration.loadConfiguration();
		Thread thread = new Thread(new DataDumpThread(conf),"Data dump thread");
		thread.setDaemon(true);
		thread.start();
	}
	
	
	
	
	public static Map<Object, Object> getData() {
		return data;
	}


	public static void put(Object key,Object value){
		data.put(key, value);
	}
	
	
	public static void add(Object key){
		Object obj = data.get(key);
		if(null == obj){
			obj = 0L;
		}
		Long number = Long.parseLong(obj.toString());
		data.put(key, number+1);
	}

	
	
	
	
}
